Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dropped Variable Statistics support for MIR #9783

Open
wants to merge 3 commits into
base: stable/20240723
Choose a base branch
from

Conversation

rastogishubham
Copy link

@rastogishubham rastogishubham commented Dec 20, 2024

This patch contains two commits:

  1. The first one refactors the code for class DroppedVariableStats to make it more extensible and moves the code specific for llvm::IR stats to it's own class called DroppedVariableStatsIR

  2. The second one adds class DroppedVariableStatsMIR to collect dropped statistics for MIR

It cherry-picks commits 5717a99, 0b5b09b, and 3bf91ad from llvm.org/main

@rastogishubham rastogishubham requested a review from a team as a code owner December 20, 2024 20:36
@rastogishubham
Copy link
Author

@swift-ci please test

@rastogishubham
Copy link
Author

@swift-ci please test Linux

@rastogishubham
Copy link
Author

@swift-ci please test macOS

Move DroppedVariableStats code to its own file and change the class to
have an extensible design so that we can use it to add dropped
statistics to MIR passes and the instruction selector.

Also moved class DroppedVariableStatsIR to its own file.

Reland 2de7881

(cherry picked from commit 5717a99)

(cherry picked from commit 0b5b09b)
This patch uses the DroppedVariableStats class to add dropped variable
statistics for MIR passes.

Reland 1c082c9

(cherry picked from commit 3bf91ad)
The DroppedVariableStats::calculateDroppedStatsAndPrint should check if
it's InlinedAts stack contains the the function name that is being
accessed to make sure that a pass did not create a new function
declaration which may then lead to a crash. For example, in hot-cold
splitting, the Module before the pass will not contain the newly created
cold function and can cause a crash when trying to access the InlinedAts
stack with the function name of the newly created cold function.

(cherry picked from commit e433fc3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants